﻿<controls:ChildWindow x:Class="AuroraPlatform.View.CartWindow"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
           xmlns:local="clr-namespace:AuroraPlatform"        
           Width="1200" Height="600" Title="我的灯具车" FontSize="13" FontFamily="Arial,Microsoft YaHei,NSimSun,SimHei" Language="zh-CN">
    <controls:ChildWindow.Resources>
        <local:ZeroValueConverter x:Key="ZeroValueConverter"/>
        <local:ProdTypeConverter x:Key="ProdTypeConverter"/>
        <local:LightingTypeConverter x:Key="LightingTypeConverter"/>
        <local:AngleConverter x:Key="AngleConverter"/>
        <local:ColorConverter x:Key="ColorConverter"/>
        <local:WidthConverter x:Key="WidthConverter"/>
        <local:VisibleConverter x:Key="VisibleConverter"/>
    </controls:ChildWindow.Resources>

    <controlsToolkit:BusyIndicator x:Name="busy">
        <Grid x:Name="LayoutRoot" Background="Transparent">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="30"/>
            </Grid.RowDefinitions>

            <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Grid.Row="2">
                <Button  Width="100" Height="23"  Margin="0,0,10,0" x:Name="ExportExcelBtn" VerticalAlignment="Center">
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" >
                        <Image Source="Images/ExportExcel.png" Width="14" Height="14" VerticalAlignment="Center"/>
                        <TextBlock Text="导出到Excel" Margin="5,0,0,0" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <Button  Width="100" Height="23"  Margin="0,0,10,0" x:Name="ExportPdfBtn" VerticalAlignment="Center">
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" >
                        <Image Source="Images/pdf.png" Width="14" Height="14" VerticalAlignment="Center"/>
                        <TextBlock Text="导出到PDF" Margin="5,0,0,0" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <Button x:Name="CancelButton" Margin="0,0,20,0" Content="关闭" Width="75" Height="23" VerticalAlignment="Center"/>
            </StackPanel>

            <Grid x:Name="TitleGrid" Grid.Row="0"/>

            <sdk:DataGrid Grid.Row="1" AlternatingRowBackground="White" RowStyle="{StaticResource DataGridRowStyle}" CellStyle="{StaticResource DataGridCell}"  VerticalScrollBarVisibility="Visible" HeadersVisibility="None" BorderThickness="0" GridLinesVisibility="Horizontal" HorizontalAlignment="Left" RowHeight="65" IsReadOnly="True" ColumnHeaderHeight="23" AutoGenerateColumns="False" VerticalAlignment="Stretch" x:Name="DataGrid">
                <sdk:DataGrid.Columns>
                    <sdk:DataGridTemplateColumn Header="产品图片" Width="70">
                        <sdk:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Image Source="{Binding PicFacade}" Stretch="Fill"/>
                                    <CheckBox VerticalAlignment="Top" HorizontalAlignment="Left" Visibility="{Binding Visibility, Mode=TwoWay}" IsChecked="{Binding IsChecked, Mode=TwoWay}"/>
                                </Grid>
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellTemplate>
                    </sdk:DataGridTemplateColumn>

                    <sdk:DataGridTextColumn Header="产品系列" Binding="{Binding ProdSeries}" Width="75"/>
                    <sdk:DataGridTextColumn Header="产品分类" Binding="{Binding ProdClass, Converter={StaticResource ProdTypeConverter}}" Width="75"/>
                    <sdk:DataGridTextColumn Header="规格型号" Binding="{Binding ProdVersion}" Width="75"/>
                    <sdk:DataGridTextColumn Header="产品品牌" Binding="{Binding ProdLabel}" Width="75"/>
                    <sdk:DataGridTextColumn Header="外形尺寸" Binding="{Binding PhySize}" Width="220"/>
                    <sdk:DataGridTextColumn Header="光源种类" Binding="{Binding AdpClass, Converter={StaticResource LightingTypeConverter}}" Width="75"/>
                    <sdk:DataGridTextColumn Header="光源功率" Binding="{Binding EleLgtPower, Converter={StaticResource ZeroValueConverter}, ConverterParameter=W}" Width="75"/>
                    <sdk:DataGridTextColumn Header="光源色温" Binding="{Binding AdpColor, Converter={StaticResource ColorConverter}}" Width="75"/>
                    <sdk:DataGridTextColumn Header="显色性" Binding="{Binding AdpCri, Converter={StaticResource ZeroValueConverter}}" Width="75"/>
                    <sdk:DataGridTextColumn Header="光束角" Binding="{Binding OptAngle, Converter={StaticResource AngleConverter}}" Width="75"/>
                    <sdk:DataGridTemplateColumn Header="市场参考价" Width="190">
                        <sdk:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <TextBlock Text="{Binding BusMarket, Converter={StaticResource ZeroValueConverter}, ConverterParameter=RMB}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
                                    <Button  Width="50" Height="23" Content="删除" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0" Click="Button_Click"/>
                                </Grid>
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellTemplate>
                    </sdk:DataGridTemplateColumn>
                </sdk:DataGrid.Columns>
            </sdk:DataGrid>
        </Grid>
    </controlsToolkit:BusyIndicator>
</controls:ChildWindow>